package com.lcxw.hxzbadmin.configcontroller;

import com.alibaba.fastjson.JSONObject;
import com.lcxw.hxzbadmin.entity.pojo.Activity;
import com.lcxw.hxzbadmin.service.configservice.ActivityService;
import com.lcxw.hxzbapi.entity.response.Response;
import java.util.List;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 活动管理
 */

@RestController
@RequestMapping("/admin/activity")
@CrossOrigin
@Slf4j
public class ActivityController {

    @Resource
    ActivityService activityService;

    /**
     * 1、获取所有活动接口
     */
    @PostMapping("/getAll")
    public Response getAllActivity(@RequestBody JSONObject requestParams){
        List<Activity> data = activityService.selectAll();
        return Response.ok(data);
    }


}
